<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>产品</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList==1">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.keyword" @keyup.enter="query" placeholder="输入(产品名,开票名,供应商名,分类名,code)任意一个进行搜索">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("sys:purchase:save")>
            <a class="btn btn-success" @click="purchaseIn"><i class="fa fa-plus"></i>&nbsp;进货</a>
			</#if>

			<#if shiro.hasPermission("sys:product:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>

			<#if shiro.hasPermission("sys:product:update")>
            <a class="btn btn-warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>

			<#if shiro.hasPermission("sys:product:delete")>
            <a class="btn btn-danger" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

<div v-show="showList==3" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">产品名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.name" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">产品编号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.code" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">供应商</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.supplierName" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">产品分类</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.categoryName" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">材质</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.material" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">型号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.model" readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">此次进货数量</div>
            <div class="col-sm-10">
                <input type="number" class="form-control" v-model="purchase.number" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">此次进货价</div>
            <div class="col-sm-10">
                <input type="number" class="form-control" v-model="purchase.price" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">建议售价</div>
            <div class="col-sm-10">
                <input type="number" class="form-control" v-model="purchase.suggestPrice" />
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-2 control-label">备注</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="purchase.remark" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" @click="purchaseInSave" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        </div>
    </form>
</div>
<div v-show="showList==2" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <div>{{purchase.pro_id}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">产品名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.name" placeholder="产品名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">开票名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.invoiceName" placeholder="产品名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">产品编号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.code" placeholder="产品名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">产品分类</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="product.cateId">
                    <option v-for="cate in categoryList" v-bind:value="cate.id">
                        {{ cate.name }}
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">供应商</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="product.supplierId">
                    <option v-for="supplier in supplierList" v-bind:value="supplier.id">
                        {{ supplier.name }}
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">材质</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.material" placeholder="材质"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">型号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.model" placeholder="型号"/>
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<div class="col-sm-2 control-label">尺寸</div>-->
            <!--<div class="col-sm-10">-->
                <!--<input type="text" class="form-control" v-model="product.size" placeholder="尺寸"/>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group">-->
            <!--<div class="col-sm-2 control-label">数量</div>-->
            <!--<div class="col-sm-10">-->
                <!--<input type="number" class="form-control" v-model="product.number" placeholder="数量"/>-->
            <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">单位</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.unit" placeholder="单位"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">状态</div>
            <label class="radio-inline">
                <input type="radio" name="status" value="1" v-model="product.isDelete"/> 禁用
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" value="0" v-model="product.isDelete"/> 正常
            </label>
        </div>

        <div class="form-group">
            <div class="col-sm-2 control-label">备注</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="product.remark" placeholder="备注"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        </div>
    </form>
</div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/product.js?_${.now?long}"></script>
</body>
</html>